import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class O46 {
    public static void main(String[] args) {
        O46 o = new O46();
        System.out.println(o.translateNum(506));
    }
    public int translateNum(int num) {
        int last = num%10;
        int re = 1;
        num/=10;
        int add = 1;
        List<Integer> list = new ArrayList<>();
        while (num!=0){
            if (num%10!=0&&(num%10<2||(num%10==2&&last<=5))){
                int t = add;
                add = re ;
                re += t;
            }else {
                list.add(re);
                re = 1;
                add = 1;
            }
            last = num%10;
            num/=10;
        }
        list.add(re);
        re = 1;
        for (Integer integer : list) {
            re*=integer;
        }
        return re;
    }
}
